<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>car game</title>
    <style>
      .main {
        --WIDTH: 300px;
        --SIDE_GAP: 35px;
        border: 1px solid #ccc;
        position: relative;
        overflow: hidden;
        background: linear-gradient(
          to right,
          rgba(96, 74, 3, 0.342),
          rgba(96, 74, 3, 0.342) var(--SIDE_GAP),
          #000 var(--SIDE_GAP),
          #000 calc(var(--SIDE_GAP) + 3px),
          #aaa calc(var(--SIDE_GAP) + 3px),
          #aaa calc(var(--WIDTH) - var(--SIDE_GAP) - 3px),
          #000 calc(var(--WIDTH) - var(--SIDE_GAP) - 3px),
          #000 calc(var(--WIDTH) - var(--SIDE_GAP)),
          rgba(96, 74, 3, 0.342) calc(var(--WIDTH) - var(--SIDE_GAP)),
          rgba(96, 74, 3, 0.342) var(--WIDTH)
        );
      }
      .road {
        position: absolute;
        left: 50%;
        transform: translate(-50%, 0);
        width: 5px;
        height: 80px;
        background-color: rgb(255, 204, 0);
        animation: road-animation 0.5s infinite linear;
      }
      @keyframes road-animation {
        from {
          top: 0;
        }
        to {
          top: 100%;
        }
      }
      .robocar {
        width: 30px;
        position: absolute;
      }
      .tree {
        width: 30px;
        position: absolute;
      }
      .tree-left {
        left: 5px;
      }
      .tree-right {
        right: 5px;
      }
      #car {
        position: absolute;
        width: 30px;
        bottom: 0;
        left: calc(50% - 15px);
        bottom: 10px;
      }
    </style>
  </head>
  <body>
    <div class="main">
      <div class="road"></div>
      <img id="car" src="./imgs/car.png" alt="" />
    </div>
    <div>当前分数：<span id="score"></span></div>
    <script src="./js/main.js"></script>
  </body>
</html>
